<?php
/**
 * Represents a javascript based required field validator.
 */
fily_XMLConverter::registerNamespace('requiredfieldvalidator', fily_RequiredFieldValidator);
class fily_RequiredFieldValidator extends fily_Validator {
    /**
     *
     */
    public function __construct() {
        parent::__construct();
        $this->setErrorMessage('*');
        
    }

    /**
     * prepares the control for the html output
     */
    public function prepare() {
        parent::prepare();
        if($this->getControlToValidate()!=null){
             $code = sprintf("firelynx.RequiredFieldValidator('%s', '%s', '%s', '%s', %s);", $this->getId(), $this->getControlToValidate()->getId(), $this->validationGroup,  $this->getDisplayStyle(), $this->getExecutionTime());
            fily_ClientCodeManager::addCode($code);
            fily_ClientCodeManager::useId($this->getId());
            fily_ClientCodeManager::useId($this->controlToValidate->getId());
          }
    }


}
?>
